<%@ page language="java" pageEncoding="UTF-8"%><%@ taglib prefix="s" uri="/struts-tags"%>
<script language="javascript" src="<%=request.getContextPath()%>/region/js/region.js"></script>
<table width="100%">
	<s:hidden name="address.id" />
	<tr>
		<td class="tdLabel">
			地址
		</td>
		<td>
			<s:if test="address!=null && address.region!=null">
				<s:property value="address.region.fullName" />
				<input type="button" value="更改" onclick="javascript:$('#region').show();" />
			</s:if>
			<div id="region" <s:if test="address!=null && address.region!=null">class="hidden"</s:if>>
				<input type="hidden" name="address.region.id" id="regionId" value="<s:property value="address.region.id"/>" />
				<font>省:<select name="province" onchange="javascript:getRegion('region', 'city',$(this).val())"></select> </font>
				<font class="hidden">市:<select name="city" onchange="javascript:getRegion('region', 'district',$(this).val())"></select> </font>
				<font class="hidden"> 区:<select name="district" onchange="javascript:$('#regionId').val($(this).val());"></select> </font>
			</div>
			<s:if test="address!=null && address.region!=null">
				<script>initRegion("region", "<s:property value="address.region.id"/>","province","city","district");</script>
			</s:if>
			<s:else>
				<script>getRegion("region", "province");</script>
			</s:else>
		</td>
	</tr>
	<s:textfield name="address.address" label="%{getText('address')}" cssClass="addressBox"/>
	<s:textfield name="address.postcode" label="%{getText('postcode')}" />
	<s:textfield name="address.email" label="%{getText('email')}" />
	<s:textfield name="address.phone" label="%{getText('phone')}" />
	<s:textfield name="address.tel" label="%{getText('tel')}" />
	<s:textfield name="address.note" label="%{getText('note')}" />
</table>
<script type="text/javascript">
function isAddressFillAll(){
	if($("#address_address").val()==""){
		alert("请填写<s:text name="address"/>!");
		return false;
	}
	if($("#address_postcode").val()==""){
		alert("请填写<s:text name="postcode"/>!");
		return false;
	}
	if($("#address_email").val()==""){
		alert("请填写<s:text name="email"/>!");
		return false;
	}
	if($("#address_phone").val()==""){
		alert("请填写<s:text name="phone"/>!");
		return false;
	}
	
	return true;
}
</script>